ABC079 C - Train Ticket
https://atcoder.jp/contests/abc079/tasks/abc079_c
提出
code: python
import itertools
abcd = input()
a = abcd
0
b = abcd
1
c = abcd
2
d = abcd
3
operator =
"-"
for i in itertools.product(operator, repeat=3):
expression = a + i
0
+ b + i
1
+ c + i
2
+ d
ans = eval(expression)
if (ans == 7):
print(expression + '=7')
break
テーマ
#itertools